package com.lhhu.demo.controller;

import com.lhhu.demo.bean.NoticeMessage;
import com.lhhu.demo.config.LogAnnotation;
import com.lhhu.demo.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther 虎
 * @Data 2021/4/11 14:23
 * @Version 1.0
 */
@RestController
public class NoticeController {
    @Autowired
    private NoticeService noticeService;

    @GetMapping("/getAllNotice")
    public List<NoticeMessage> getAllNotice(){
        return noticeService.getAllNotice();
    }

    @LogAnnotation(module = "前端管理模块",action = "更新公告")
    @PutMapping("/updateNotice")
    public int updateNotice(String codes,String message1,String message2,String message3){
        return noticeService.updateNotice(message1,message2,message3);
    }
}
